<?php
class phpAction extends Action {
	function index(){
		$user = D('jiuye');

		//分页
		$size=2;
		$p = intval($_GET['p']);
		$p = $p==0 ? 1 : $p;
		$start = ($p-1)*$size;
		$count = $user->count();
		
		import('ORG.Util.Page');
		$page = new Page($count,$size);
		$str = $page->myshow('/php-gongzuoshi','-');
		$this->assign('str',$str);
		
		$list = $user->limit("$start,$size")->findAll();
		//echo $study->getlastsql();
		$this->assign('list',$list);
		
		pubAction::get_slist();
		$this->display('default@php');
	}
	
	function show(){
		$id = intval($_GET['id']);
		$user = D('jiuye');
		$lab = $user->where('id='.$id)->find();
		$this->assign('lab',$lab);
		
		pubAction::get_slist();
		$this->display('default@php_show');
	}
	
	
}
?>